import 'package:o_amap/aMapModule/common/latlng.dart';

class InputTipsResult {
  List<Tips> tips;

  InputTipsResult({this.tips});

  InputTipsResult.fromJson(Map<String, dynamic> json) {
    if (json['tips'] != null) {
      tips = new List<Tips>();
      json['tips'].forEach((v) {
        tips.add(new Tips.fromJson(v));
      });
    }
  }

  Map<String, dynamic> toJson() {
    final Map<String, dynamic> data = new Map<String, dynamic>();
    if (this.tips != null) {
      data['tips'] = this.tips.map((v) => v.toJson()).toList();
    }
    return data;
  }
}

class Tips {
  String adcode;
  String address;
  String district;
  String name;
  String poiID;
  String typeCode;
  LatLng point;

  String provinceName;
  String cityName;
  String adName;
  String distance;

  Tips(
      {this.adcode,
        this.address,
        this.district,
        this.name,
        this.poiID,
        this.typeCode,
        this.point,
        this.provinceName,
        this.cityName,
        this.adName,
        this.distance});

  Tips.fromJson(Map<String, dynamic> json) {
    adcode = json['adcode'];
    address = json['address'];
    district = json['district'];
    name = json['name'];
    poiID = json['poiID'];
    typeCode = json['typeCode'];
    point = json['point'] != null ? new LatLng.fromJson(json['point']) : null;

    provinceName = json['provinceName'];
    cityName = json['cityName'];
    adName = json['adName'];
    distance = json['distance'];
  }

  Map<String, dynamic> toJson() {
    final Map<String, dynamic> data = new Map<String, dynamic>();
    data['adcode'] = this.adcode;
    data['address'] = this.address;
    data['district'] = this.district;
    data['name'] = this.name;
    data['poiID'] = this.poiID;
    data['typeCode'] = this.typeCode;
    if (this.point != null) {
      data['point'] = this.point.toJson();
    }

    data['provinceName'] = this.provinceName;
    data['cityName'] = this.cityName;
    data['adName'] = this.adName;
    data['distance'] = this.distance;
    return data;
  }
}
